//
//  LikeControl.m
//  FreeTime
//
//  Created by  on 16/8/25.
//  Copyright © 2016年 SRDZ.com. All rights reserved.
//

#import "LikeControl.h"
#import "Header.h"
#import "LikeCell.h"
@interface LikeControl ()<UITextViewDelegate>{
    NSArray * dataArr;

}


@end

@implementation LikeControl

- (void)viewDidLoad {
    [super viewDidLoad];
    [self loadOrigData];
}
- (void)loadOrigData{
    self.navigationItem.title = @"喜欢";
    NSArray * nameArr = @[@"可爱的西红柿",@"这个大黄瓜毕竟没有温度",@"sa菇凉"];
    NSArray * timeArr = @[@"喜欢于1月30",@"喜欢于48分",@"喜欢于11:39"];
    for (int i = 0; i<3; i++) {
        NSDictionary * dict = @{@"iconImg":@"123",@"name":nameArr[i],@"time":timeArr[i]};
        [self.dataArray addObject:dict];
    }
    
}
#pragma mark tableViewMethord
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.dataArray.count;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSDictionary * dict = [LikeCell cellFrame:self.dataArray[indexPath.row] indexPath:indexPath];
    self.dataArray[indexPath.row] = dict;
    return [dict[@"cellHeight"] integerValue];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString * cellIdentifier = @"LikeCell";
    LikeCell * cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
    if (cell == nil) {
        cell = [[LikeCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        
    }
    cell.tag = 100+indexPath.row;
    //    FriendsCell * cell = [tableView cellForRowAtIndexPath:indexPath];
    [cell bindData:self.dataArray[indexPath.row] indexPath:indexPath];
    return cell;
}

@end
